Copyright: ® Guy J. Gallo


Help Contents
Contents

ChooseDirectory

Overview

Installation

The Dialog Box

The CDIR.INI file

Advanced Topics

Installation Tips

Extensions

Warning:

Support Macros

ChooseDirAddGroup

ChooseDirAddThisFile

FileSummaryInfo

UpdateVer2To3

Registration

Fee

Upgrades fee

Address

gToolBox


Overview

ChooseDirectory begain life in response to a WordPerfect user. Someone on the Word for Windows forum of CIS complained that Word version 1.x did not provide an easy way to specify a default startup directory. I set out to prove that not only could Word open in a specified directory, it could go one better and provide an easily customized list of alternate startup directories. I was told by the Word programmer's that ChooseDirectory was the first significant macro written by an end-user, and that it made the rounds in Redmond. A version was published by PC-Computing. With each iteration, new features and new smarts have been added.

ChooseDirectory 3.0 adds some significant enhancements: The list is larger, there are now Cut and Paste buttons, new items are added at the point of the selection, there is a sort button, CD now uses a dedicated INI file (rather than writing to a section of WIN.INI). Three support macros are also include in this release.

This version is specific to Word for Windows version 2.0x. It will not work with earlier versions of Word for Windows.


Installation

This Word for Windows 2.0 document  (actually a template disguised as a document) was distributed with a sample CDIR.INI file. This configuration file contains some settings based upon a default Word installation (that is, it assumes Word was installed into \WINWORD ). Before installing the ChooseDirectory macro contained in this template, you might want to copy CDIR.INI into your Windows directory. Nothing serious will happen if you don't. However, the purpose and functioning of ChooseDirectory will be easier to demonstrate if you use this sample configuration file.

If you do not copy CDIR.INI into you Windows directory, you will be presented with a blank list when you run ChooseDirectory for the first time.

The CDIR.HLP file should be copied into your Windows directory as well.


The Dialog Box

When you execute ChooseDirectory you will see the following dialog box:

Description

Extensions

Open

New

Help

Edit

Add

Cut

Paste

Sort


Description

This listbox contains plain English descriptions that point to a directory , a search path, a document, or multiple documents. The description should be chosen carefully to reflect the underlying load command.


ChooseDirectory - The Dialog Box - Extensions
Extensions

This combo box contains a list of extensions to use when you open a directory. The default is DOC (or whatever you have specified as the DOC-Extension in your WIN.INI). If you type in an alternate extension that is not already in the list, it will be saved for future use by ChooseDirectory.

(To remove an extension from the list, simply type the extension prefaced by an minus sign: e.g. -TMP. See Extensions .)


Open

Selecting this option button executes a different function depending on the current selection. The description can "point to"  a directory, a single document, multiple documents, or a search path.

If the description points to a path, ChooseDirectory will display the FileOpen dialog in that directory.

If the description points to a document,  ChooseDirectory will open that document.

If the description points to multiple documents, ChooseDirectory will open all specified documents.

If the description points to a searh path, FileFind will run using that path specification as the SearchList.


New

Selecting this button changes to the directory pointed to by the description, and then executes FileNew.


ChooseDirectory - The Dialog Box - Help
Help

Loads the CDIR.HLP file.


Edit

Selecting this button will display the following dialog box:

Below is a table of the variations allowed in the load command line and the corresponding action when the Open or New buttons are selected:

Load Command	Open	New
C:\WINWORD	FileOpen	FileNew
C:\WINWORD\MYDOC.DOC	Open the document	FileNew
C:\ONE.DOC+C:\TWO.DOC	Open both documents	FileNew
C:\WINWORD;	FileFind	FileNew
C:\WINWORD;C:\WIN	FileFind	FileNew first directory
C:\WINWORD\*.*;	FileFind on path with extension	FileNew
•	If the load command is a directory, [directory] will be added to the description.

•	If the load command is a multiple path specification, [search path] will be added to the description.

•	If the load command is a document, [document] will be added to the description.

•	If the load command points to multiple documents, [multiple docs] will be added to the description.

•	If the load command points to a template (DOT), [template] will be added to the description.

Buttons on the Edit dialog box:

Select File

Help


Select File

Selecting this button will display the FileOpen dislog box. This allows you to select a file to add to the load command.

To have ChooseDirectory work on just the path you have selected, be sure to remove the file name that is inserted (and the final backslash)

To do multiple paths remember to add a semi-colon between paths. (Note that if you wish to run FileFind on a single directory, you must end the load command with a ";".)

To do multiple documents remember to add a plus sign between file names.


ChooseDirectory - Edit - Help
Help

Load the CDIR.HLP file with information about editing and adding items.


Add

Selecting this button will display the same dialog box as that displayed by the Edit button.

Inserts  a new item at the current location of the highlight in the list.


Cut

Selecting this option simply removes the currently selected description/path from the list.

Note: there is no confirmation.

The "cut" item (that is, the description and load command pair) is stored in a temporary buffer.


Paste

Pastes the contents of the buffer at the current highlight location. Used with the Cut command this allows you to move individual items.

Note: This button does not appear until you have selected Cut.


Sort

This command sorts the description list alphabetically and writes the new order to disk.


The CDIR.INI file

ChooseDirectory uses a series of keywords stored in a dedicated INI file named CDIR.INI.

Below is an example CDIR.INI:

[ChooseDirectory]

Count=7

Extensions=4

[Items]

1=All Files in Winword [search path]|c:\winword\*.*;

2=Block Letter [template]|C:\WINWORD\LETBLOCK.DOT

3=Example Macro [document]|C:\WINWORD\NEWMACRO.DOC

4=Product Support Macros [document]|C:\WINWORD\PSS.DOC

5=PSS and NewMacros [multiple docs]|C:\WINWORD\NEWMACRO.DOC+C:\WINWORD\PSS.DOC

6=The ReadMe Doc [document]|C:\WINWORD\README.DOC

7=Windows and WinWord [search path]|c:\win\*.*;c:\winword

[Extensions]

1=DOT

2=*

3=TXT

4=WFW

CDIR.INI is located in your Windows directory. It can be edited directly using NOTEPAD.EXE (or any other text editor).


Installation Tips

To have ChooseDirectory run every time you start Word for Windows, simply either add the following line to your current AutoExec macro (or create one if none exists):

ToolsMacro "ChooseDirectory", .Run

You should also assign ChooseDirectory to both a menu and a key combination.


Advanced Topics - Extensions
Extensions

Specifying an extension

You can add a specific extension to a path. For instance, if the description "My templates" points to a path in the following form:

C:\WINWORD\DOT\*.DOT

Then upon execution this will run FileOpen on the C:\WINWORD\DOT directory, with *.DOT as the filter.

Note: the bracketed "type" description generated by ChooseDirectory will still read [document].

Similarly, you can add an extension to the items in a multiple path, as follows:

C:\WFW\*.DOC;C:\DOT\*.DOT

Upon execution, FileFind will run with this as the SearchPath.

Note: the bracketed "type" description generated by ChooseDirectory will still read [search path].

Deleting an extension from the list

When you specify an extension, it is added to the list. To remove an extension from the list, run ChooseDirectory and type in the extension you wish to remove prefaced by a minus sign: e.g. . -TMP.

Sorting the extension list

Extensions will be displayed in the list in the following order: DOC will always come first; the remaining extensions will display in the order you entered them.

To re-arrange the alternative extensions you must edit the extension lines in the CDIR.INI file, which can be found in your Windows subdirectory.


Warning:

The CDIR.INI lines that contain the description/path specification must contain text on either side of the vertical bar (otherwise an error will be generated). This version of ChooseDirectory contains error checking to make it very difficult to incorrectly install these lines, however, nothing is fool proof... If you get an error when first running the macro, please check your CDIR.INI (using NOTEPAD) and examine the section following [extensions]. If you see a line with nothing to one side of the vertical bar, such as --

1=Main Directory|

-then you know there is a problem. Add the missing information manually.


ChooseDirAddGroup

This macro will prompt you with a list of all open documents. You can add any or all to a load command.


ChooseDirAddThisFile

This macro will examine the FileSummaryInfo of the current document and propose the Title as the ChooseDirectory description.

With your confirmation, it will add the description and directory information to the end of the current ChooseDirectory list.


FileSummaryInfo

This is a replacement for the internal FileSummaryInfo macro. After calling the normal dialog box to fill in Title, Subject, etc, you will be prompted whether or not to add this document to the ChooseDirectory list.


UpdateVer2To3

If you currently use a earlier version of ChooseDirectory (prior to 3.0) this macro will copy the settings contained in WIN.INI to the new configuration file CDIR.INI.

The settings in WIN.INI are not automatically deleted.

You do not need to install this macro. Simply execute it once, using the Test button from the installation dialog box.


Fee

This macro is distributed as ShareWare. If you use  the macros contained in this document, please register.

A fee of $15.00 per macro/installation is required.

Corporate site licenses are available. Please contact the author at the address below and a fee will be negotiated for the specific macro and use involved.


Upgrades fee

If you are already registered for a prior version of ChooseDirectoryversion 3.0 ChooseDirectory, the fee for registering this version is $5.00.


Address

Guy J. Gallo
219 East 69th Street
New York, NY 10021

Please post any suggestions or bugs or flaws in the documentation to me at that address, or at any of the following Electronic addresses:

CIS 71171,3555

MCI Mail gjgallo - 538-8541

Internet gg2@columbia.COM

PCBoard: SmartNet, InterLink, Rime, or Intelec Windows conferences.


gToolBox

ChooseDirectory 3.0 will be distributed as a stand-alone package. Prior versions were included in a packet of macros known as gToolBox.

The current version of gToolBox is 1.0.

Registration of gToolBox is 39.95.

However, if you register ChooseDirectory 3.0, registration for the total gToolBox package is discounted to 29.95.

gToolBox  can be found as:  GTBX10.EXE (on CIS) or GTBX10.ZIP.

gToolBox contains the following macros:

ChangeQuoteDash - SmartQuotes "post processor".  Toggle between Typewriter and Typeset style quotation marks and dashes

ChangeTool -  Delete or Insert a tool

ControlRun -   Replaces built-in Control run.  Adds command line and custom buttons.

CopyMacroActive - Copy a macro from one active template to another.  Great for developers.  Easier than ManageMacros.  Optionally encrypt.

CreateOutlineDoc - Save only the heading levels of a document to another document.

DeleteIdleStyles - Remove idle user styles.

EncryptMacros    - Encrypt macro(s) in the current template

EncryptTemplate - Encrypt an entire template

FiddleNotes - Manipulate footnotes and annotations.  Remove from the document. Make one into the other.

FileTemplate - Replacement for built in FileTemplate.  This merges template styles into the document when it is attached.

MacroKey - Assign key combinations to macros.  This allows many more key combinations than the built in ToolsOptionsKeyboard:  such as Alt+Shift combinations, some direction keys (like AltUp and AltDown).

MakeBook - Suggests the first 26 characters of the selection as a bookmark.

MakeWordBook - Turns the current word into a bookmark.  Increments if the proposed bookmark duplicates an existing bookmark:  Word, Word1, Word2

ManageKeys - Display a list of key combinations.

ManageMacros - The original.  Copy macros from one template to another.

OpenMRUList  - Open the entire Most Recently Used file list (the four files at the bottom of the File menu).  Nice as a startup macro.

PrintRange - Print a range of pages (1,4,10-20,);  or all Odd or all Even. Works across sections (as far as I know...)

ReInsertNotes - At last.  It works.  This macro fixes a bug in the footnote and annotation reference styles.  If you change the definition of these styles subsequent to inserting a note, the changes only effect NEW notes, not the ones already in the document.  This macro goes through a document and re-inserts all notes or annotations (and thereby applying the *new* style).  This allows you, for instance, to toggle footnotes between hidden and non-hidden.  Now supports custom footnotes.

SyncStyles - Synchronize the style definitions between a document and a template. Either direction.

ToggleHidden - Toggle hidden on/off

ToggleOutline - Toggle outline view on/off

TogglePictures - Toggle picture placeholders on/off

ToggleRevision - Toggle Revision marks on/off

ToggleStyleBar - Toggle style bar on/off

ToggleViewTools - A single, simple dialog box that contains the seven possible "view" tools:  Ribbon, Ruler, ToolBar, Status bar, vScroll, hScroll, and Style bar.  Turning them all on or all off or selected on is simple and basically a two keystroke procedure.

ToggleWindow  - Toggle window split.

WindowStack - Cascade all document windows (the window command MS left out).

WinSideBySide - Arrange two documents side by side.  If you have more than one document open, you are presented with a list of the other documents (other than the active one) to choose from (the window command MS didn't even think about).

gLib - This is the macro library.  It is no longer encrypted. It contains commands that are used by other gToolBox macros.  You can also use them in your own macros.  It contains the following:

ActivatePartial(Doc$), CheckLib, Chew$(Source$, Marker$), CountChar(Source$, Char$), fExist(FullPathName$), fFileCount(FileSpec$), fFileName$(b$), fFileNameExt$(b$), fStr$(Num), GetDocDir$, GetFile(FullName$, Dir$, Default$), GetPath$(Source$), GetTemplate$, gLibInstalled(Macro$), gMsg(Msg$, Title$), gQuery(Msg$, Title$), HasKey(Macro$, Context), Inject$(Source$,  New$,  Place), IsMacroPane([MacroName$]), KeyDescription$(KeyCode), lHelp(HelpFileName$), lcHelp(ContextNumber, HelpFileName$), ListMacros$(Context, All), LoopMsg(Message$), MacroExist(Macro$), NoSlash(Source$), NukeTopMenu, Replace$(Source$, Old$, New$), ResetTopMenu, Reverse$(Source$,  Marker$), SameFormat, SelectSameFormatRight, Split(Source$, Marker$, First$, Second$), Trim$(Source$, ZapChar$), Wait(Seconds)